<style>

    textarea{

        resize: none;

    }

	.btn_box{

		    width: 100px;

    height: 40px;

    text-align: center;

    color: #fff;

    background: #26c17b;

    border: none;

    outline: none;

    cursor: pointer;

    display: block;

		}

</style>

<!-- 内容 -->

<div id="right_box">

<div class="right_a">

            <a href="/empress/wechart.php"><span class="right_box1 set_menu" style="border:1px solid #fff"><div class="btn_box">自定义菜单</div></span></a>
            <a href="/empress/wechart.php?action=subscribe"><span class="right_box1 set_menu"><div class="btn_box">首次关注设置</div></span></a>
            <a href="/empress/wechart.php?action=set_token"><span class="right_box1 set_menu"><div class="btn_box">微信接口配置</div></span></a>
            <a href="/empress/wechart.php?action=material"><span class="right_box1 set_menu"><div class="btn_box">图文消息管理</div></span></a>
            
            <a href="/empress/wechart.php?action=option_url"><span class="right_box1 set_menu"><div class="btn_box">自定义URL</div></span></a>

           

        </div>

  <link href='/static/adm/css/main.css' rel='stylesheet' type='text/css' />

<link href='/static/adm/css/global.css' rel='stylesheet' type='text/css' />

<link href='/static/adm/css/wechat.css' rel='stylesheet' type='text/css' />

<script type='text/javascript' src='/static/adm/js/jquery.min.js'></script>

<script type='text/javascript' src='/static/adm/js/global.js'></script>

<script type='text/javascript' src='/static/adm/js/wechat.js?<?php echo time();?>'></script>



	<div class="wrap">

		

		<script type='text/javascript' src='/static/adm/dragsort/dragsort-0.5.1.min.js'></script>

<script language="javascript">$(document).ready(wechat_obj.menu_init);</script>

<div id="wechat_menu" class="r_con_wrap">

	<div class="m_menu">

		<div class="tips">
			1. 您的公众平台帐号类型必须升级为<span>服务号</span>。<br />
			2. 升级为服务号后，必须在微信公众平台申请接口使用的<span>AppId</span>和<span>AppSecret</span>，然后在【<a href="./?m=wechat&a=auth">微信授权配置</a>】中设置。<br />
			3. 最多创建<span>3</span>个一级菜单，每个一级菜单下最多可以创建<span>5</span>个二级菜单，菜单最多支持两层。<br />
			4. 拖动树形菜单可以对菜单重排序，但最终只有“<span>发布菜单</span>”后才会生效，公众平台限制了每天的发布次数，请勿频繁操作。<br />
			5. 微信公众平台规定，<span>菜单发布24小时后生效</span>。您也可先取消关注，再重新关注即可马上看到菜单。<br />
			6. 点击“<span>删除菜单</span>”操作只删除微信公众平台上的菜单，并不是删除本系统已经设置好的菜单。
		</div>

		<div class="form">

			<div class="m_lefter">

				<dl>

                   <?php foreach($menu as $k=>$r){?>

                   <?php if($r['parent_id']==0){?>

                                        <dd MId="<?php echo $r['id'];?>">

                                            <div class="list ">

                                                <a href="/empress/wechart.php?mid=<?php echo $r['id']?>" title="修改"><img src="/static/adm/images/mod.gif" align="absmiddle" /></a>

                                                <a href="/empress/wechart.php?do_action=wechat.menu_del&mid=<?php echo $r['id']?>" title="删除" onClick="if(!confirm('删除后不可恢复，继续吗？')){return false};"><img src="/static/adm/images/del.gif" align="absmiddle" /></a>

                                                <?php echo $r['menu_name'];?>

                                               </div>

                                                    <ul>

                    <?php foreach($menu as $kk=>$rr){?>

                     <?php if($rr['parent_id']==$r['id']){?>

                                                        <li MId="<?php echo $rr['id'];?>">

                                                            <div class="title"><img src="/static/adm/images/jt.gif" /> <?php echo $rr['menu_name'];?></div>

                                                            <div class="opt">

                                                                <a href="/empress/wechart.php?mid=<?php echo $rr['id']?>"><img src="/static/adm/images/mod.gif" /></a>

                                                                <a href="/empress/wechart.php?do_action=wechat.menu_del&mid=<?php echo $rr['id']?>" onClick="if(!confirm('删除后不可恢复，继续吗？')){return false};"><img src="/static/adm/images/del.gif" /></a>

                                                            </div>

                                                        </li>

                     <?php }?>

                    <?php }?>

                                                    </ul>

                                            <div class="blank9"></div>

                                        </dd>

                    <?php }?>

                    <?php }?>

				</dl>

				<div class="publish"><input type="button" class="btn_green" name="publish_btn" value="发布菜单" /><input type="button" class="btn_gray" name="del_btn" value="删除菜单" /></div>

							</div>

			<div class="m_righter">

				<form id="wechat_menu_form" class="/empress/wechart.php">

					<h1>添加菜单</h1>

					<div class="opt_item">

						<label>菜单名称：</label>

						<span class="input"><input type="text" name="menu_name" value="<?php echo $menuinfo['menu_name']?>" class="form_input" size="15" maxlength="15" notnull /> <font class="fc_red">*</font></span>

						<div class="clear"></div>

					</div>

											<div class="opt_item">

							<label>添加到：</label>

							<span class="input"><select name="parent_id">

								<option value="0" <?php if($menuinfo['parent_id']==0){ ?>selected="selected"<?php }?>>一级菜单</option>

                                <?php foreach($menu as $ki=>$i){?>

                                <?php if($i['parent_id']==0){?>

                                     <option value="<?php echo $i['id']; ?>" <?php if($menuinfo['parent_id']==$i['id']){ ?>selected="selected"<?php }?> ><?php echo $i['menu_name']?></option>

                                <?php }?>

                                <?php }?>

								</select></span>

							<div class="clear"></div>

						</div>

						<div class="opt_item">

						<label>消息类型：</label>

						<span class="input"><select name="replay_type">

							<option value="0" <?php if($menuinfo['replay_type']==1||$menuinfo['replay_type']==''){ ?>selected="selected"<?php }?>>文字消息</option>

							<option value="1" <?php if($menuinfo['replay_type']==2){ ?>selected="selected"<?php }?>>图文消息</option>

							<option value="3" <?php if($menuinfo['replay_type']==3){ ?>selected="selected"<?php }?>>连接网址</option>

						</select></span>

						<div class="clear"></div>

					</div>

					<div class="opt_item" id="text_msg_row">

						<label>文字内容：</label>

						<span class="input"><textarea name="contents_txt"><?php echo $menuinfo['contents_txt'];?></textarea></span>

						<div class="clear"></div>

					</div>

					<div class="opt_item" id="img_msg_row">

						<label>图文内容：</label>

						<span class="input">

						<select name='contents_img'>

						<?php echo $resUrl;?>

						</select>

						

						</span>

						<div class="clear"></div>

					</div>

					<div class="opt_item" id="url_msg_row">

						<label>链接网址：</label>

						<span class="input"><input type="text" name="contents_link" value="<?php echo $menuinfo['contents_link'];?>" class="form_input" size="35" maxlength="200" /></span>

						<div class="clear"></div>

					</div>

					<div class="opt_item">

						<label></label>

						<span class="input"><input type="submit" class="btn_green btn_w_120" name="submit_button" value="<?php if($menuinfo['id']==''){ ?>添加菜单<?php }else{?>修改菜单<?php }?>"></span>

						<div class="clear"></div>

					</div>

					<input type="hidden" name="do_action" value="wechat.menu">

					<input type="hidden" name="mid" value="<?php echo $menuinfo['id'];?>">

					<input type="hidden" name="ajax" value="1">

				</form>

			</div>

			<div class="clear"></div>

		</div>

	</div>

</div>

</div>